package com.cndw.kungfu.model.pvp.war;

import java.util.Comparator;

public class WarPlayerCompartor implements Comparator<WarPlayer> {

	@Override
	public int compare(WarPlayer o1, WarPlayer o2) {
		int diff = o2.getPp() - o1.getPp();
		if (diff == 0) {
			diff = (int) (o2.getPid() - o1.getPid());
			if (diff ==0) {
				diff = o2.getSid() - o1.getSid();
				if (diff ==0) {
					diff = o2.hashCode() - o1.hashCode();
				}
			}
		}
		return diff;
	}

}
